#pragma once

#include "clkAbstract.h"

enum TEX_CENTER
{
	TEX_C,
	TEX_TC,TEX_BC,TEX_LC,TEX_RC,
	TEX_TL,TEX_TR,TEX_BL,TEX_BR,
};

class clkTexture : public clkAbstract
{
protected:
	DTexture2D m_texture;

	bool m_hasTexture;
	bool m_isHover;
	bool m_isClick;
	bool m_isHeld;

	V2DF m_min;
	V2DF m_max;
	V2DF m_cur;

	V2DF  m_cen;
	V2DF  m_trn;
	V2DF  m_scl;
	float m_rot;
public:
	clkTexture();
	~clkTexture();

	void initTexture(
		char* a_texturePath,
		int   a_cen,
		V2DF  a_trn,
		V2DF  a_scl,
		float a_rot);
	
	virtual void input();
	virtual void update();
	virtual void draw();

	bool hasTexture(){return m_hasTexture;}
	bool isHover(){return m_isHover;}
	bool isClick(){return m_isClick;}
	bool isHeld(){return m_isHeld;}

	void setCen(V2DF a_cen){m_cen = a_cen;}
	void setTrn(V2DF a_trn){m_trn = a_trn;}
	void setScl(V2DF a_scl){m_scl = a_scl;}
	void setRot(float a_rot){m_rot = a_rot;}

	V2DF getCen(){return m_cen;}
	V2DF getTrn(){return m_trn;}
	V2DF getScl(){return m_scl;}
	float getRot(){return m_rot;}

	V2DF getMax(){return m_max;}
	V2DF getMin(){return m_min;}
	float getWidth(){return (float)m_texture.m_texWidth;}
	float getHeight(){return (float)m_texture.m_texHeight;}

	V2DF& refCen(){return m_cen;}
	V2DF& refTrn(){return m_trn;}
	V2DF& refScl(){return m_scl;}
	float& refRot(){return m_rot;}
};